home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 113 / XENIATGM113.iso / Patch / No One Lives Forever / NOLFUpdate003.exe / Setup / English / english.rul < prev    next >
Text File  |  2001-04-25  |  3KB  |  100 lines

  1. //
  2. // ENGLISH UPDATE setup.rul
  3. //
  4. // NOTE:  Changes made to this script should be made to the scripts for each 
  5. //          other language too!
  6. //
  7.  
  8. // Game & folder names
  9. #define APP_TITLE       "NOLF Update (v1.003)"
  10. #define APP_NAME        "No One Lives Forever"
  11. #define APP_VERSION     "1.0"
  12. #define APP_KEY         "NOLF.exe"
  13. #define DEFAULT_PATH    "Fox\\No One Lives Forever"
  14. #define DEFAULT_GROUP   "Fox Interactive\\No One Lives Forever"
  15. #define UPDATE_VERSION    "1.003"
  16. #define UPDATE_COMMAND    "-rez Nolfu003.rez -rez Nolfcres003.rez"
  17. #define README_FILE        "READMEU003.TXT"
  18.  
  19. declare
  20.     NUMBER  nResult;
  21.     NUMBER  nType, nSize;
  22.     STRING  svSrcDir, svTargetDir;
  23.     STRING  svRegKey;
  24.     STRING  svTemp;
  25.     STRING  svVersion;
  26.  
  27. program
  28. start:
  29.     // Set paths
  30.     svSrcDir     = SRCDIR ^ "..\\..\\";
  31.  
  32.     // Setup screen & title
  33.     Enable(BACKGROUND);
  34.     SetColor(BACKGROUND, RGB(236, 164, 4));
  35.     SetTitle(APP_TITLE, 26, WHITE);
  36.  
  37.     SetColor(STATUSBAR, BK_SOLIDBLUE);
  38.     PlaceBitmap(svSrcDir ^ "SETUP\\NOLF1.BMP", 1, CENTERED, CENTERED, CENTERED);
  39.     Delay(2);
  40.  
  41.     // Get installed path from registry
  42.     RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
  43.     svRegKey = "Software\\Monolith Productions\\" + APP_NAME + "\\" + APP_VERSION;
  44.     nType = REGDB_STRING;
  45.     nSize = -1;
  46.     nResult = RegDBGetKeyValueEx(svRegKey, "WorkingDirectory", nType, svTargetDir, nSize);
  47.     if (nResult < 0) then
  48.         svTemp = "Unable to update " + APP_NAME + " to version " + UPDATE_VERSION + "!\n\nMake sure " + APP_NAME +
  49.                  " is installed correctly!";
  50.         MessageBox(svTemp, WARNING);
  51.         exit;
  52.     endif;
  53.  
  54.     // Check version number of what's already installed
  55.     nType = REGDB_STRING;
  56.     nSize = -1;
  57.     nResult = RegDBGetKeyValueEx(svRegKey, "Version", nType, svVersion, nSize);
  58.     if (nResult = 0) then
  59.         nResult = StrCompare(svVersion, UPDATE_VERSION);
  60.         if (nResult > 0) then
  61.             svTemp = "You are currently running v" + svVersion +
  62.             " of " + APP_NAME +".\n\nYou cannot update to v" + UPDATE_VERSION + 
  63.             ".\n\nYou can download the latest " + APP_NAME +
  64.             " Updates from: http://www.the-operative.com";
  65.             MessageBox(svTemp, INFORMATION);
  66.             exit;
  67.         endif;
  68.     endif;
  69.  
  70.     // Show status window
  71.     Disable(FEEDBACK_FULL);
  72.     Enable(STATUS);
  73.     Enable(INDVFILESTATUS);
  74.     PlaceWindow(STATUS, CENTERED, 0, LOWER_RIGHT);
  75.     SetStatusWindow(0, "Updating " + APP_NAME + "...");
  76.  
  77.     // Copy all game files...
  78.     StatusUpdate(ON, 100);
  79.     SRCDIR    = svSrcDir ^ "GAME";
  80.     TARGETDIR = svTargetDir;
  81.     CopyFile("*.*", "*.*");
  82.  
  83.     // Display done message
  84.     SetStatusWindow(1000, "Update complete!");
  85.  
  86.     // Set new registry keys
  87.     RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
  88.     RegDBSetKeyValueEx(svRegKey, "Version", REGDB_STRING, UPDATE_VERSION, -1);
  89.     RegDBSetKeyValueEx(svRegKey, "Update Command Line", REGDB_STRING, UPDATE_COMMAND, -1);
  90.  
  91.     // Do the readme...
  92.  
  93.      svTemp = "The " + APP_NAME + " Update is complete!  Would you like to read the README file now?";
  94.     if (AskYesNo(svTemp, YES) = YES) then
  95.         LaunchAppAndWait("NOTEPAD.EXE " + svTargetDir ^ README_FILE, "", NOWAIT);
  96.     endif;
  97.  
  98. exit;
  99.  
  100.